﻿using System;
using System.Collections.Generic;
using System.Text;


using GDCommon.Util;
using GDCommon.Xml;

namespace GDBLL.Scene.Control
{
    public class MapManager:IMapManager
    {
        //TODO:Cache
        private static object lockHelper = new object();

        private static MapList s_maplist = null;

        private static string path = Common.GetMapPath("~/config/MapSetting.config");

        static MapManager()
        {
        }

        public string GetMap(int id)
        {
            return "";
        }

        public MapList LoadMap()
        {
            lock (lockHelper)
            {
                s_maplist = (MapList)XmlHelper.Load(typeof(MapList), path);
            }
            return s_maplist;
        }

        public void SaveMap(MapList ml)
        {
            XmlHelper.Save(ml, path);
        }
    }
}
